<ul id="gameContainer3"></ul>
<!-- Declare a JsRender template, in a script block: -->
<script id="gameTmp3" type="text/x-jsrender">
        {{for list}}

        <li>
          <a href="game.html?id={{:Id}}"
            ><div class="img">
              <img
                data-src="{{:cover}}"
                src="{{:cover}}"
                lazy="loaded"
              />
            </div>
            <div class="info">
              <div class="name">{{:name}}</div>
              <div class="star">
                <img
                  alt=""
                  src=""
                />
                <img
                  alt=""
                  src=""
                />
                <img
                  alt=""
                  src=""
                />
                <img
                  alt=""
                  src=""
                />
                <img
                  alt=""
                  src=""
                />
              </div>
              <div class="prop">
                {{:desc}}
              </div>
            </div>
            <div class="go">GO</div></a
          >
        </li>
     {{/for}}
</script>

<script>
  $.ajax({
    url:
      "https://app.nocodb.com/api/v2/tables/mg01furv08tboqh/records?viewId=vwkcjs6aeek51qs1&" +
      window.gamelistParam,
    type: "GET",
    dataType: "json",
    headers: {
      "xc-token": "dePwLQ88UMbt4O9ndpBSQ-6RUC_nIhhpPea_0kTR",
    },
    contentType: "application/json; charset=utf-8",
    success: function (gameData) {
      // item Template
      let gameTmp3 = $.templates("#gameTmp3");
      // let gameList = {},
      //   list = [];
      // gameData.list.map(item => {
      //   gameList[item.tag] = gameList[item.tag]
      //     ? [...gameList[item.tag], item]
      //     : [item];
      // });
      // list = Object.entries(gameList).map(([key, value]) => ({
      //   name: key,
      //   list: value,
      // }));
      // console.log(list);
      let gameHtml = gameTmp3.render(gameData);
      $("#gameContainer3").html(gameHtml);
    },
    error: function (error) {
      console.error(error);
    },
  });
</script>
